﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace UtilZ.Dotnet.Ex.Communication.Net.BMQ
{
    /// <summary>
    /// BMQ传话消息ID生成器
    /// </summary>
    internal class BMQSessionIdGenerator
    {
        static BMQSessionIdGenerator()
        {
            _sessionIdLock = new object();
        }

        private static volatile short _sessionId = 10;
        private static object _sessionIdLock = null;

        public static short Generate()
        {
            lock (_sessionIdLock)
            {
                return _sessionId++;
            }
        }
    }
}
